home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / lib / gcc-lib / ppc-amigaos / 2.95.1 / sys-include / powerpc / tasksPPC.h < prev    next >
C/C++ Source or Header  |  2000-03-13  |  5KB  |  141 lines

  1. #ifndef POWERPC_TASKSPPC_H
  2. #define POWERPC_TASKSPPC_H
  3.  
  4. #ifndef POWERPC_PORTSPPC_H
  5. #include <powerpc/portsPPC.h>
  6. #endif
  7.  
  8. #ifndef EXEC_TASKS_H
  9. #include <exec/tasks.h>
  10. #endif
  11.  
  12. #ifndef UTILITY_TAGITEM_H
  13. #include <utility/tagitem.h>
  14. #endif
  15.  
  16. /* private structure */
  17.  
  18. struct TaskLink {
  19.         struct MinNode tl_Node;
  20.         APTR tl_Task;
  21.         ULONG tl_Sig;
  22.         UWORD tl_Used;
  23. };
  24.  
  25. /* task structure for ppc. fields not commented are private*/
  26.  
  27. struct TaskPPC {
  28.         struct Task tp_Task;                    /* exec task structure */
  29.         ULONG tp_StackSize;                     /* stack size: read only */
  30.         APTR tp_StackMem;
  31.         APTR tp_ContextMem;
  32.         APTR tp_TaskPtr;
  33.         ULONG tp_Flags;                         /* flags (see below): read only */
  34.         struct TaskLink tp_Link;
  35.         APTR tp_BATStorage;
  36.         ULONG tp_Core;
  37.         struct MinNode tp_TableLink;
  38.         APTR tp_Table;                          /* task's page table: read only */
  39.         ULONG tp_DebugData;                     /* free space for debuggers */
  40.  
  41.         UWORD tp_Pad;
  42.         ULONG tp_Timestamp;
  43.         ULONG tp_Timestamp2;
  44.         ULONG tp_Elapsed;
  45.         ULONG tp_Elapsed2;
  46.         ULONG tp_Totalelapsed;
  47.         ULONG tp_Quantum;
  48.         ULONG tp_Priority;
  49.         ULONG tp_Prioffset;
  50.         APTR tp_PowerPCBase;
  51.         ULONG tp_Desired;
  52.         ULONG tp_CPUusage;                      /* CPU usage: read only */
  53.         ULONG tp_Busy;                          /* busy time: read only */
  54.         ULONG tp_Activity;                      /* activity: read only */
  55.         ULONG tp_Id;                            /* task ID: read only */
  56.         ULONG tp_Nice;                          /* NICE value: read only */
  57.         struct MsgPortPPC* tp_Msgport;          /* Msg port: read only */
  58.         struct List tp_TaskPools;               /* private: for V15-MM */
  59. }; /* don't depend on sizeof(TaskPPC) */
  60.  
  61. #define NT_PPCTASK 100
  62.  
  63. /* tc_State (additional task states) */
  64.  
  65. #define TS_CHANGING      7
  66.  
  67. /* tp_Flags */
  68.  
  69. #define TASKPPCB_SYSTEM    0
  70. #define TASKPPCB_BAT       1
  71. #define TASKPPCB_THROW     2
  72. #define TASKPPCB_CHOWN     3
  73. #define TASKPPCB_ATOMIC    4
  74.  
  75. #define TASKPPCF_SYSTEM    (1L<<0)
  76. #define TASKPPCF_BAT       (1L<<1)
  77. #define TASKPPCF_THROW     (1L<<2)
  78. #define TASKPPCF_CHOWN     (1L<<3)
  79. #define TASKPPCF_ATOMIC    (1L<<4)
  80.  
  81. /* tags passed to CreateTaskPPC */
  82.  
  83. #define TASKATTR_TAGS       (TAG_USER+0x100000)
  84. #define TASKATTR_CODE       (TASKATTR_TAGS+0)   /* entry code */
  85. #define TASKATTR_EXITCODE   (TASKATTR_TAGS+1)   /* exit code */
  86. #define TASKATTR_NAME       (TASKATTR_TAGS+2)   /* task name */
  87. #define TASKATTR_PRI        (TASKATTR_TAGS+3)   /* task priority */
  88. #define TASKATTR_STACKSIZE  (TASKATTR_TAGS+4)   /* task stacksize */
  89. #define TASKATTR_R2         (TASKATTR_TAGS+5)   /* smalldata/TOC base */
  90. #define TASKATTR_R3         (TASKATTR_TAGS+6)   /* first parameter */
  91. #define TASKATTR_R4         (TASKATTR_TAGS+7)
  92. #define TASKATTR_R5         (TASKATTR_TAGS+8)
  93. #define TASKATTR_R6         (TASKATTR_TAGS+9)
  94. #define TASKATTR_R7         (TASKATTR_TAGS+10)
  95. #define TASKATTR_R8         (TASKATTR_TAGS+11)
  96. #define TASKATTR_R9         (TASKATTR_TAGS+12)
  97. #define TASKATTR_R10        (TASKATTR_TAGS+13)
  98. #define TASKATTR_SYSTEM     (TASKATTR_TAGS+14)  /* private */
  99. #define TASKATTR_MOTHERPRI  (TASKATTR_TAGS+15)  /* inherit mothers pri */
  100. #define TASKATTR_BAT        (TASKATTR_TAGS+16)  /* BAT MMU setup (BOOL) */
  101. #define TASKATTR_NICE       (TASKATTR_TAGS+17)  /* initial NICE value (-20..20)*/
  102. #define TASKATTR_INHERITR2  (TASKATTR_TAGS+18)  /* inherit r2 from parent task
  103.                                                    (overrides TASKATTR_R2) (V15+) */
  104. #define TASKATTR_ATOMIC     (TASKATTR_TAGS+_19) /* noninterruptable task */
  105.  
  106. /* taskptr structure */
  107.  
  108. struct TaskPtr {
  109.         struct Node tptr_Node;
  110.         APTR tptr_Task;
  111. };
  112.  
  113. /* return values of ChangeStack */
  114.  
  115. #define CHSTACK_SUCCESS  -1
  116. #define CHSTACK_NOMEM    0
  117.  
  118. /* parameter to ChangeMMU */
  119.  
  120. #define CHMMU_STANDARD   1
  121. #define CHMMU_BAT        2
  122.  
  123. /* tags passed to SnoopTask */
  124.  
  125. #define SNOOP_TAGS          (TAG_USER+0x103000)
  126. #define SNOOP_CODE          (SNOOP_TAGS+0)      /* pointer to callback function */
  127. #define SNOOP_DATA          (SNOOP_TAGS+1)      /* custom data, passed in r2 */
  128. #define SNOOP_TYPE          (SNOOP_TAGS+2)      /* snoop type (see below) */
  129.  
  130. /* possible values of SNOOP_TYPE */
  131.  
  132. #define SNOOP_START     1                       /*monitor task start */
  133. #define SNOOP_EXIT      2                       /*monitor task exit */
  134.  
  135. /* possible values for the CreatorCPU parameter of the callback function */
  136.  
  137. #define CREATOR_PPC     1
  138. #define CREATOR_68K     2
  139.  
  140. #endif
  141.